package net.bezrabotnih.client.managed.ui;

import com.google.gwt.requestfactory.ui.client.ProxyRenderer;
import net.bezrabotnih.client.managed.request.PhotoProxy;
import net.bezrabotnih.client.managed.request.ThumbnailProxy;

public class ThumbnailProxyRenderer extends ProxyRenderer<ThumbnailProxy> {

    private static net.bezrabotnih.client.managed.ui.ThumbnailProxyRenderer INSTANCE;

    protected ThumbnailProxyRenderer() {
        super(new String[] { "fileName" });
    }

    public static net.bezrabotnih.client.managed.ui.ThumbnailProxyRenderer instance() {
        if (INSTANCE == null) {
            INSTANCE = new ThumbnailProxyRenderer();
        }
        return INSTANCE;
    }

    public String render(ThumbnailProxy object) {
        if (object == null) {
            return "";
        }
        return object.getFileName() + " (" + object.getId() + ")";
    }
}
